package com.lagou.provider.server.impl;

import com.lagou.service.HelloService;
import lombok.extern.log4j.Log4j;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

/**
 * @author 陶肖寅
 * @version V1.0
 * @Package com.lagou.provider.server.impl
 * @email fromlx@126.com
 * @date 2020-04-16 23:18
 * @Copyright © 2020-2021 城云科技(中国)有限公司
 */
@Service
@Log4j
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        log.info("Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
        return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
    }
}
